#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(from_string = '@ Final CI energies and residual',
      num_lines = 2,
      rel_tolerance = 1.0e-5)

f.add(from_string = 'Occupancies of natural orbitals',
      to_string = 'Head-Gordon',
      abs_tolerance = 1.0e-5)

f.add(from_string = 'Molecular orbitals for symmetry species 1',
      num_lines = 11,
      ignore_sign=True,
      rel_tolerance = 1.0e-3)

f.add(from_string = 'Molecular orbitals for symmetry species 2',
      num_lines = 6,
      ignore_sign=True,
      rel_tolerance = 1.0e-3)

f.add(from_string = 'Molecular orbitals for symmetry species 3',
      num_lines = 8,
      ignore_sign=True,
      rel_tolerance = 1.0e-3)

test.run(['cino.dal'], ['H2O.mol'], f={'out': f})

sys.exit(test.return_code)
